package com.uiotsoft.projectmanager.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.uiotsoft.projectmanager.common.entity.JsonResult;
import com.uiotsoft.projectmanager.model.User;
import com.uiotsoft.projectmanager.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/test")
@RestController
public class TestController extends BaseController{

    @Autowired
    private UserService userService;

    @RequestMapping("/info")
    public JsonResult info(){
        User byId = userService.getById(1);
        User user = userService.getOne(Wrappers.<User>lambdaQuery().eq(User::getUserId, 1));

        QueryWrapper<User> qryWrapper = new QueryWrapper<>();
        qryWrapper.eq("user_id",1);
        qryWrapper.eq(false,"s",1);
        User one = userService.getOne(qryWrapper);

        return JsonResult.ok(one);
    }
}
